#include<stdio.h>
int main()
{
	int a,b,c;
	while(scanf("%d %d",&a,&b)!=EOF)
	{
		c=a/b;
		a=a%b;
		printf("%d %d\n",c,a);
	}
	return 0;
}